ListNode* removeElements(ListNode* head, int val) {
         ListNode* dummyhead = new ListNode(0);  //设置一个val为0的头节点
         
         dummyhead->next = head;
         ListNode* cur = dummyhead;
         while(cur->next != NULL){
             if(cur->next->val == val){
                 ListNode* del = cur->next;
                 cur->next = del->next;
                 delete del;
             }
             else
                cur = cur->next;
         }
         head = dummyhead->next;
         delete dummyhead;
         return head;
     }